package models.sys;

import com.alibaba.fastjson.JSONObject;
import exception.OverPowerException;
import play.db.jpa.Model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name="sys_trash")
public class Trash extends Model{
    public Trash(String table, JSONObject data, AdminUser user) {
        if (user == null)
            throw new OverPowerException("没有找到登录用户信息,请检查登录状态!");
        this.table_name = table;
        this.table_data = data.toString();
        this.deleDate = new Date();
        this.operator = user.getInfo().toString();
        this.account = user.username;
    }
    public String account;
    @Column(columnDefinition="TEXT default NULL")
    public String operator;
    public Date deleDate;
    public String table_name;
    @Column(columnDefinition="TEXT default NULL")
    public String table_data;
}
